﻿#region ExcuteHalconProc_Execute.cs
// ============================================================================
// This region will be filled automatically with data if you are working
// for example with Microsoft SourceSafe
//
// Purpose:          
// Specifics: 
// 
// Creation date:    2024/1/3 21:32:37
// Created by:       hao.chen
//
// $Author:        $
// $Date:          $
// $Revision:      $
// $History:       $
// $NoKeywords:    $
// 
// Copyright:      © 2024 YourCompanyName
//                 All Rights Reserved
// ============================================================================
#endregion

#define EXCUTEHALCON
//#undef EXCUTEHALCON

using CLVisionHalconNC620.Transform;
using HalconDotNet;
using NeuroCheck.PlugInLib.API;
using NeuroCheck.PlugInLib.Base;
using NeuroCheck.PlugInLib.Drawing;
using NeuroCheck.PlugInLib.ImageProcessing;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

// TODO: Namespace - Modify the namespace to the project namespace
namespace CLVisionHalconNC620
{
    /// <summary>This class implements the execute code of the check function "ExcuteHalconProc"
    /// which is called by the execute method in file ExcuteHalconProc.cs.
    /// Because of this separation this class can be obfuscated.
    /// <remarks>If you don't use obfuscation just implement your execute code within the execute method
    /// in file "ExcuteHalconProc.cs" and delete this file from project.
    /// </remarks>
    /// </summary>
	public partial class ExcuteHalconProcExecute
    {
        // TODO: Other - Define a class member for the check function parameters, uncomment or remove the line below.
        /// <summary>Parameters of the check function "ExcuteHalconProc".</summary>
        private ExcuteHalconProcParameter m_Parameter;
        // TODO: Other - Define a class member for the check function target values, uncomment or remove the line below.
        /// <summary>Target values of the check function "ExcuteHalconProc".</summary>
        //private ExcuteHalconProcTargetValue m_TargetValue;
        /// <summary>Data that is necessary for the execution of this check function.</summary>
        private NcPICheckFunctionExecutionArgs m_ExecutionArgs;
        //****HTupleVector
       
        HTupleVector outputHtuple = new HTupleVector(1);

        HObject[] outputHobj;

        // TODO: Other - Modify the signature and summary.
        /// <summary>Constructor.
        /// </summary>
        /// <param name="exeArgs">The execution arguments containing the runtime (input and output) data.</param>
        /// <param name="parameter">Parameters of the check function "ExcuteHalconProc".</param>
        /// <param name="targetValue">Target values of the check function "ExcuteHalconProc".</param>
        //  public ExcuteHalconProcExecute(NcPICheckFunctionExecutionArgs exeArgs)
        //  public ExcuteHalconProcExecute(NcPICheckFunctionExecutionArgs exeArgs, ExcuteHalconProcParameter parameter, ExcuteHalconProcTargetValue targetValue)
        public ExcuteHalconProcExecute(NcPICheckFunctionExecutionArgs exeArgs, ExcuteHalconProcParameter parameter)
        {
            m_ExecutionArgs = exeArgs;
            // TODO: Other - Assign check function parameters, uncomment or remove the line below
            m_Parameter = parameter;
            // TODO: Other - Assign check function target values, uncomment or remove the line below
            // m_TargetValue = targetValue;
        }


        // TODO: Other - Modify the signature and summary
        /// <summary>Implements the execute functionality.
        /// </summary>
        /// <param name="imgInput">Input image.</param>
        /// <param name="isInAutomaticMode">Determines if this check function is currently executing in automatic mode.</param>
        /// <returns>Execution result as <c>NcPIExecutionResultInfo</c>.</returns>
        public NcPIExecutionResultInfo Execute(NcPIImage imgInput, NcPICheckFunctionBase ncPICheckFunctionBase, bool isInAutomaticMode)
        // public NcPIExecutionResultInfo Execute(NcPIImage imgInput, bool isInAutomaticMode)
        {
            return ExcuteHalcon.Excute(m_Parameter, ncPICheckFunctionBase, out outputHtuple, out outputHobj);
        }


    } // end of class
} // end of namespace